//
//  UILabel+Extension.swift
//  GeekTime
//
//  Created by monkey on 2020/1/30.
//  Copyright © 2020 itcast. All rights reserved.
//

import UIKit

extension UILabel
{
    /// 便利构造方法
    /// - Parameters:
    ///   - text: 文本
    ///   - textColor: 文本颜色
    ///   - fontSize: 字体
    ///   - textAlignment: 对齐方式
    public convenience init(text: String = "",textColor: UIColor,fontSize: CGFloat = 15,textAlignment: NSTextAlignment = .left)
    {
        self.init()
        self.text = text
        self.textColor = textColor
        self.font = UIFont.systemFont(ofSize: fontSize)
        self.textAlignment = textAlignment
        self.numberOfLines = 0
        sizeToFit()
    }
}
